<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>

  <TITLE>CS631 -- Advanced Programming in the UNIX Environment</TITLE>
  <STYLE type="text/css">
  body {
  background-color: #FFFFFf;
  }
  </STYLE>
  <STYLE type="text/css">
  li.c1 {list-style: none}
  </STYLE>

</HEAD>

<BODY>
  <TABLE border="1" align="center" cellpadding="15">
    <TR>
      <TD valign="top">
        <H2>CS631 -- Advanced Programming in the UNIX Environment - HW#3</H2>

        <H3>HW#3: webserver framework</H3>

        <H4>Summary</H4>
	<p>The objective of this assignment is for you to lay down the
	basic framework and HTTP functionality for your <a href="f16-final-project.html">final
 	project</a>.  This ensures that your final project will be on
        track.</p>

	<p>In particular, you are to write the following portions of your
	final project:
	<ul>
	<li>the <tt>main</tt> function, parsing all command-line options
	and setting all flags</li>
	<li>the basic code to listen on the given network address and
	port, accept connections</li>
        <li>basic HTTP protocol validation</li>
	</ul>
	Your rudimentary server will read one line of text from any
	connecting client and validate that the input is a proper HTTP
        request.  It will then return the correct HTTP code for the
        following use cases:
	<ul>
	  <li>input was a valid HTTP request supported by this server =&gt; 200 OK</li>
	  <li>input was a valid HTTP request not supported by this server =&gt; 501 Not Implemented</li>
          <li>input was a valid HTTP request of an HTTP version not supported by
	      this server =&gt; 505 Version Not Supported</li>
	  <li>input was an invalid request =&gt; 400 Bad Request</li>
	</ul>
        Your server should also time out open client connections after a
        suitable amount of time, yielding a 408 or 522 Connection Timed
        Out status.
	</p>

	<h4>Deliverables and Due Date</H4>
	<p>You will submit at least three files:
	<ul>
	<li><tt>main.c</tt> - containing the basic functionality</li>
	<li><tt>net.c</tt> - containig any network related functionality</li>
        <li><tt>http.c</tt> - containing HTTP specific functionality</li>
	<li><tt>Makefile</tt></li>
	</ul>
	</p>
	<p>You will submit a single <tt>tar</tt> archive named
	<em>username1-username2</em>-hw3.tar that will extract
	into a directory named after your group's usernames.
	</p>
	<p>
       	The due date for this assignment is 2016-11-07 16:00.  Please
	attach the file to an email sent from your <tt>@stevens.edu</tt>
	email address to <a
	href="mailto:pmurray1@stevens.edu?subject=[CS631] HW3">pmurray1@stevens.edu</a>
	with a subject of "[CS631] HW3".
	</p>
        <hr>
        [<a href="index.html">Course Website</a>]
</BODY>
</HTML>
